window.__require = function e(t, i, n) {
	function o(c, s) {
		if (!i[c]) {
			if (!t[c]) {
				var r = c.split("/");
				if (r = r[r.length - 1], !t[r]) {
					var d = "function" == typeof __require && __require;
					if (!s && d) return d(r, !0);
					if (a) return a(r, !0);
					throw new Error("Cannot find module '" + c + "'")
				}
				c = r
			}
			var h = i[c] = {
				exports: {}
			};
			t[c][0].call(h.exports, function(e) {
				return o(t[c][1][e] || e)
			}, h, h.exports, e, t, i, n)
		}
		return i[c].exports
	}
	for (var a = "function" == typeof __require && __require, c = 0; c < n.length; c++) o(n[c]);
	return o
}({
	"main-controller": [function(e, t) {
		"use strict";
		cc._RF.push(t, "b98b3qdOFRGyLAy9f+rCPiF", "main-controller");
		var i = e("./weixin").wxShareConfig,
			n = cc.Class({
				extends: cc.Component,
				properties: {
					delay: 0,
					count: 0,
					scores: 0,
					level: 0,
					speed: 10,
					shakeLastX: 0,
					shakeLastY: 0,
					shakeThreshold: 15,
					shakeTimeOut: 1e3,
					shakeLastTime: null,
					isIdle: !1,
					scoresLabel: cc.Label,
					gameNode: cc.Node,
					overLineNode: cc.Node,
					warningAnimation: cc.Animation,
					warningLineNode: cc.Node,
					productRootNode: cc.Node,
					startGameModal: cc.Node,
					startButton: cc.Button,
					gameOverModal: cc.Node,
					reStartButton: cc.Button,
					lotteryButton: cc.Button,
					toHkcButton: cc.Button,
					overScoresLabel: cc.Label,
					wantAudio: cc.AudioSource,
					tapAudio: cc.AudioSource,
					overAudio: cc.AudioSource,
					bgmAudio: cc.AudioSource,
					mainCamera: cc.Camera,
					prefabLeftWall: cc.Node,
					prefabRightWall: cc.Node,
					prefabBottomWall: cc.Node,
					prefabSBoom: cc.Prefab,
					prefabGBoom: cc.Prefab,
					prefabNiunaitang: {
					default:
						null, type: cc.Prefab
					},
					prefabXiaomantou: {
					default:
						null, type: cc.Prefab
					},
					prefabXianbei: {
					default:
						null, type: cc.Prefab
					},
					prefabXuebing: {
					default:
						null, type: cc.Prefab
					},
					prefabWangzainiunai: {
					default:
						null, type: cc.Prefab
					},
					prefabLangweixian: {
					default:
						null, type: cc.Prefab
					},
					prefabHeibaipei: {
					default:
						null, type: cc.Prefab
					},
					prefabCaomei: {
					default:
						null, type: cc.Prefab
					},
					prefabMaozhua: {
					default:
						null, type: cc.Prefab
					},
					prefabDalibao: {
					default:
						null, type: cc.Prefab
					},
					prefabNianwang: {
					default:
						null, type: cc.Prefab
					},
					prefabNiu: {
					default:
						null, type: cc.Prefab
					},
					currentProductNode: null
				},
				onLoad: function() {
					var e = this,
						t = cc.director.getPhysicsManager();
					t.enabled = !0, t.gravity = cc.v2(0, -3e3), t.enabledAccumulator = !0, t.FIXED_TIME_STEP = .1, t.VELOCITY_ITERATIONS = 2, t.POSITION_ITERATIONS = 2, cc.director.getCollisionManager().enabled = !0, cc.director.getCollisionManager().enabledDebugDraw = !0, this.overLineNode.main = this, this.warningAnimation.node.active = !1;
					var i = "https://www.hotkidclub.com/q/pG";
					try {
						var n = new URLSearchParams(window.location.search).get("sess");
						i = n ? i + "?sess=" + n : i
					} catch (o) {
						console.error(o)
					}
					this.startButton.node.on("click", this.firstStartGame, this), this.reStartButton.node.on("click", this.reStartGame, this), this.lotteryButton.node.on("click", function() {
						window.location.href = i
					}, this), this.toHkcButton.node.on("click", function() {
						window.location.href = "https://www.hotkidclub.com/q/pS"
					}, this), "undefined" != typeof wx && wx.miniProgram.getEnv(function(t) {
						console.log(t), t.miniprogram && (e.toHkcButton.active = !1)
					}), this.gameOverModal.active = !1
				},
				start: function() {
					this.createShareDom();
					var e = window.location.origin + window.location.pathname;
					cc.resources.load("img/wx-share", function(t, n) {
						i({
							title: "旺仔合成大作战",
							desc: "旺从天降，新年让我们做坠旺的仔 ！",
							link: "https://www.hotkidclub.com/q/pU",
							imgUrl: e + n.nativeUrl
						})
					})
				},
				update: function() {},
				firstStartGame: function() {
                    console.log("firstStartGame");
					var e = this;
					this.bgmAudio.play(), cc.systemEvent.on(cc.SystemEvent.EventType.DEVICEMOTION, this.shakeScene, this), cc.tween(this.startGameModal).to(.4, {
						position: cc.v2(0, -10)
					}, {
						easing: "sineOut"
					}).to(1, {
						position: cc.v2(0, 1624)
					}, {
						easing: "quintIn"
					}).call(function() {
						e.startGame(), e.startGameModal.active = !1
					}).start()
				},
				reStartGame: function() {
					var e = this;
					this.bgmAudio.play(), cc.tween(this.gameOverModal).to(.8, {
						position: cc.v2(0, 800)
					}, {
						easing: "quintIn"
					}).call(function() {
						e.startGame(), e.gameOverModal.active = !1
					}).start()
				},
				startGame: function() {
					this.init(), this.createWantProduct(), this.node.on("touchstart", this.tweenMoveProduct, this), this.node.on("touchmove", this.moveProduct, this), this.node.on("touchend", this.putDownProduct, this)
				},
				init: function() {
					this.productRootNode.children.forEach(function(e) {
						return e.destroy()
					}), this.isIdle = !1, this.warningAnimation.setCurrentTime(0), this.scores = 0, this.level = 0, this.count = 0, this.overScoresLabel.string = this.scoresLabel.string = this.scores.toString()
				},
				createWantProduct: function() {
					this.checkWarning();
					var e = [this.prefabCaomei, this.prefabXiaomantou, this.prefabNiunaitang, this.prefabMaozhua, this.prefabLangweixian],
						t = this.level >= 5 ? 5 : this.level + 1,
						i = e[Math.floor(Math.random() * t)],
						n = cc.instantiate(i);
					n.y = this.overLineNode.y + 50, n.pIndex = this.count, this.count++, this.productRootNode.addChild(n), n.main = this, this.currentProductNode = n
				},
				upgradeProduct: function(e, t) {
					var i;
					switch (e) {
					case "caomei":
						i = cc.instantiate(this.prefabXiaomantou), 0 === this.level && (this.level += 1), this.addScore(1);
						break;
					case "xiaomantou":
						i = cc.instantiate(this.prefabNiunaitang), 1 === this.level && (this.level += 1), this.addScore(5);
						break;
					case "niunaitang":
						i = cc.instantiate(this.prefabMaozhua), 2 === this.level && (this.level += 1), this.addScore(10);
						break;
					case "maozhua":
						i = cc.instantiate(this.prefabLangweixian), 3 === this.level && (this.level += 1), this.addScore(20);
						break;
					case "langweixian":
						i = cc.instantiate(this.prefabXianbei), 4 === this.level && (this.level += 1), this.addScore(50);
						break;
					case "xianbei":
						//i = cc.instantiate(this.prefabXuebing), 5 === this.level && (this.level += 1), this.addScore(100);
						break;
					/*case "xuebing":
						i = cc.instantiate(this.prefabWangzainiunai), 6 === this.level && (this.level += 1), this.addScore(7);
						break;
					case "wangzainiunai":
						i = cc.instantiate(this.prefabDalibao), 7 === this.level && (this.level += 1), this.addScore(50);
						break;
					case "dalibao":
						i = cc.instantiate(this.prefabNianwang), 8 === this.level && (this.level += 1), this.addScore(100);
						break;
					case "nianwang":
						i = cc.instantiate(this.prefabNiu), 9 === this.level && (this.level += 1), this.addScore(1e3)*/
					}
					if (i) if ("niu" === i.name) this.boomNiu(i);
					else {
						this.wantAudio.play(), i.pIndex = this.count, this.count++, i.setPosition(t);
						var n = i.scale;
						i.scale = .1, i.opacity = 100, this.productRootNode.addChild(i), i.isRigidActive = !0, cc.tween(i).to(.1, {
							scale: n + .5,
							opacity: 255
						}).to(.1, {
							scale: n
						}).start(), i.main = this
					}
				},
				boomNiu: function(e) {
					var t = this;
					this.isIdle = !0, this.productRootNode.children.forEach(function(e, i) {
						e.isDestroying = !0, setTimeout(function() {
							t.wantAudio.play(), cc.tween(e).to(.2, {
								position: cc.v2(0, t.overLineNode.y + 130)
							}).call(function() {
								e.destroy()
							}).start()
						}, 200 * i)
					}), setTimeout(function() {
						var i = cc.instantiate(t.prefabGBoom);
						t.gameNode.addChild(i), i.setPosition(0, t.overLineNode.y), cc.tween(i).to(.6, {
							scale: {
								value: 2.4,
								easing: "quintIn"
							},
							opacity: 255
						}).call(function() {
							i.destroy(), e.pIndex = t.count, t.count++, e.setPosition(0, t.overLineNode.y + 100), t.productRootNode.addChild(e), e.isRigidActive = !0, e.main = t, t.wantAudio.play(), t.isIdle = !1, setTimeout(function() {
								t.createWantProduct()
							}, 1e3)
						}).start()
					}, 200 * this.productRootNode.children.length)
				},
				captureScreen: function() {
					var e = new cc.RenderTexture,
						t = cc.game._renderContext;
					e.initWithSize(cc.visibleRect.width, cc.visibleRect.height, t.STENCIL_INDEX8), this.mainCamera.targetTexture = e, this.mainCamera.render();
					var i = e.readPixels(),
						n = document.createElement("canvas"),
						o = n.getContext("2d"),
						a = n.width = e.width,
						c = n.height = e.height;
					n.width = e.width, n.height = e.height;
					for (var s = 4 * a, r = 0; r < c; r++) {
						for (var d = c - 1 - r, h = o.createImageData(a, 1), u = d * a * 4, l = 0; l < s; l++) h.data[l] = i[u + l];
						o.putImageData(h, 0, r)
					}
					var p = n.toDataURL("image/jpeg"),
						g = document.createElement("img");
					g.src = p, g.style = "z-index: 100", document.body.appendChild(g)
				},
				tweenMoveProduct: function(e) {
					if (this.currentProductNode) {
						var t = e.getLocation(),
							i = this.node.convertToNodeSpaceAR(t);
						i.x > 360 && (i.x = 360), i.x < -360 && (i.x = -360), cc.tween(this.currentProductNode).to(.1, {
							position: cc.v2(i.x, this.currentProductNode.y)
						}).start()
					}
				},
				moveProduct: function(e) {
					if (this.currentProductNode) {
						var t = e.getLocation(),
							i = this.node.convertToNodeSpaceAR(t);
						i.x > 360 && (i.x = 360), i.x < -360 && (i.x = -360), this.currentProductNode.x = i.x
					}
				},
				putDownProduct: function() {
					var e = this;
					this.currentProductNode && (this.currentProductNode.isRigidActive = !0, this.tapAudio.play(), this.currentProductNode = null, setTimeout(function() {
						e.isIdle || e.createWantProduct()
					}, this.delay))
				},
				checkWarning: function() {
					var e = this.warningLineNode.getBoundingBoxToWorld();
					if (cc.director.getPhysicsManager().testAABB(e).some(function(e) {
						return e.node.isContacted
					})) {
						if (this.warningAnimation.node.active) return;
						this.warningAnimation.node.active = !0
					} else this.warningAnimation.node.active = !1
				},
				shakeScene: function(e) {
					var t = e.accelerationIncludingGravity || e.acc;
					this.shakeLastX || (this.shakeLastX = t.x), this.shakeLastY || (this.shakeLastY = t.y), this.shakeLastZ || (this.shakeLastZ = t.z), this.shakeLastTime || (this.shakeLastTime = new Date);
					var i = Math.abs(this.shakeLastX - t.x),
						n = Math.abs(this.shakeLastY - t.y);
					if (Math.abs(this.shakeLastY - t.z), (i > this.shakeThreshold || n > this.shakeThreshold) && (new Date).getTime() - this.shakeLastTime.getTime() > this.shakeTimeOut) {
						var o = cc.director.getPhysicsManager();
						i > this.shakeThreshold ? (o.gravity = cc.v2(1500, 1500), setTimeout(function() {
							o.gravity = cc.v2(-1500, 1500)
						}, 100)) : (o.gravity = cc.v2(-1500, 1500), setTimeout(function() {
							o.gravity = cc.v2(1500, 1500)
						}, 100)), setTimeout(function() {
							o.gravity = cc.v2(0, -3e3)
						}, 300), this.shakeLastTime = new Date
					}
					this.shakeLastX = t.x, this.shakeLastY = t.y, this.shakeLastZ = t.z
				},
				addScore: function(e) {
					if (this.scores += e, this.overScoresLabel.string = this.scoresLabel.string = this.scores.toString(), this.level > 9) {
						var t = document.getElementById("shareContain");
						cc.resources.load("img/share-img2", function(e, i) {
							t.getElementsByTagName("img")[0].src = i.nativeUrl
						})
					}
				},
				createShareDom: function() {
					document.getElementById("shareContain");
					var e = document.createElement("div");
					e.setAttribute("id", "shareContain"), e.innerHTML = '<img style="width: 90%" /><div id="close" style="margin-top: 10px;width: 50px;display: flex;justify-content: center;"><img style="display: block;width: 44px;height: 44px;" /></div>', e.style = "z-index: 100; width: 100%; height: 100% ;display: none; flex-direction: column; justify-content: center; align-items: center; background: #000;", cc.resources.load("img/share-img1", function(t, i) {
						e.getElementsByTagName("img")[0].src = i.nativeUrl
					}), cc.resources.load("img/close", function(t, i) {
						e.getElementsByTagName("img")[1].src = i.nativeUrl
					}), document.body.appendChild(e)
				},
				shareImg: function() {
					if (this.gameOverModal.setPosition(cc.v2(0, 0)), this.gameOverModal.active = !0, !this.isShow) {
						this.closeShare(), this.isShow = !0;
						var e = document.getElementById("shareContain");
						e.style.display = "flex", e.style.opacity = 0;
						var t = 0,
							i = setInterval(function() {
								t++, e.style.opacity = t / 30, t >= 30 && clearInterval(i)
							}, 10)
					}
				},
				closeShare: function() {
					document.getElementById("close").onclick = function() {
						document.getElementById("shareContain").style.display = "none"
					}
				},
				gameOver: function() {
					var e = this;
					this.bgmAudio.stop(), this.wantAudio.stop(), this.overAudio.play(), this.isIdle = !0, this.productRootNode.children.forEach(function(e) {
						return e.isDestroying = !0
					}), this.node.off("touchstart", this.tweenMoveProduct, this), this.node.off("touchmove", this.moveProduct, this), this.node.off("touchend", this.putDownProduct, this), setTimeout(function() {
						e.shareImg()
					}, 2e3)
				}
			});
		t.exports = n, cc._RF.pop()
	}, {
		"./weixin": "weixin"
	}],
	"over-line": [function(e, t) {
		"use strict";
		cc._RF.push(t, "5b258lnrANMbLiQP7/Kggay", "over-line"), cc.Class({
			extends: cc.Component,
			properties: {
				redMaterial: cc.Material
			},
			onLoad: function() {},
			start: function() {},
			onEndContact: function(e, t, i) {
				if (i.node.isContacted && !i.node.isDestroying) {
					var n = this.node.getChildByName("warningAnimation").getComponent(cc.Animation);
					n.pause(), n.setCurrentTime(1), i.node.getComponent(cc.Sprite).setMaterial(0, this.redMaterial), i.node.isDestroying = !0, this.node.main.gameOver()
				}
			}
		}), cc._RF.pop()
	}, {}],
	product: [function(e, t) {
		"use strict";
		cc._RF.push(t, "4e05dhNT2dFJ543hPwIS3W1", "product");
		var i = cc.Class({
			extends: cc.Component,
			properties: function() {
				return {
					size: 1,
					isRigidActive: !1,
					isShake: !1,
					rigidBody: {
						type: cc.RigidBody,
					default:
						null
					}
				}
			},
			onLoad: function() {
				"niu" !== this.node.name && (this.node.angle = Math.floor(360 * Math.random() + 1)), this.node.isRigidActive = this.isRigidActive, this.rigidBody = this.getComponent(cc.RigidBody)
			},
			start: function() {
				this.rigidBody.active = !1
			},
			update: function() {
				if (this.node.isRigidActive && (this.node.isRigidActive = !1, this.rigidBody.active = !0), this.node.isDestroying && (this.rigidBody.active = !1), this.node.isUpgrade) {
					this.node.isUpgrade = !1;
					var e = this.node.getPosition(),
						t = this.node.name,
						i = this.node.main;
					this.node.destroy(), setTimeout(function() {
						i.upgradeProduct(t, e)
					}, 100)
				}
			},
			onBeginContact: function(e, t, i) {
				if ("overLine" !== i.node.name && "left" !== i.node.name && "right" !== i.node.name && (t.node.isContacted = !0), i.node.name === t.node.name && t.node.pIndex > i.node.pIndex) {
					if (t.node.isUpgrade || t.node.isDestroying) return;
					t.node.isDestroying = !0, i.node.isUpgrade = !0;
					var n = i.node.getPosition();
					cc.tween(t.node).to(.2, {
						position: n,
						scale: .3,
						opacity: 0
					}).call(function() {
						t.node.destroy()
					}).start()
				}
			}
		});
		t.exports = i, cc._RF.pop()
	}, {}],
	"start-button": [function(e, t) {
		cc._RF.push(t, "75652KzIXpA6KbZLPtfrtVg", "start-button"), cc.Class({
			extends: cc.Component,
			properties: {},
			start: function() {
				console.log("yxxxxxx1"+this.node.position.y);
				this.node.setPosition(0,-500);
				cc.tween(this.node).repeatForever(cc.tween().to(2, {
					opacity: 200,
					scale: .9
				}).to(2, {
					opacity: 230,
					scale: 1
				})).start()
			}
		}), cc._RF.pop()
	}, {}],
	"use_v2.1-2.2.1_cc.Toggle_event": [function(e, t) {
		"use strict";
		cc._RF.push(t, "492c1ck23pOGJb3PFgzBxns", "use_v2.1-2.2.1_cc.Toggle_event"), cc.Toggle && (cc.Toggle._triggerEventInScript_isChecked = !0), cc._RF.pop()
	}, {}],
	weixin: [function(e, t, i) {
		"use strict";
		cc._RF.push(t, "e2e95mUbXpE5oXLofGZpZrT", "weixin"),
        i.__esModule = !0,
        i.wxShareConfig = void 0,
        i.wxShareConfig = function(e) {
			var t, i, a, c, s;
			t = "POST", i = "/api/member/wx/jsapi/ticket.ctrl", a = {
				pageUrl: location.href.split("#")[0],
				type: "HKC"
			}, c = function(t) {
				n(t.Response.data), o(e)
			}, (
                s = new XMLHttpRequest).open(t, i);
                //"POST" == t ? (s.setRequestHeader("Content-Type", "application/json"), s.send(JSON.stringify(a))) : s.send(),
                /*s.onreadystatechange = function() {
                    if (4 === s.readyState && 200 === s.status) {
                        var e = JSON.parse(s.responseText);
                        c(e)
                    }
			    }*/
		};
		var n = function(e) {
				wx.config({
					appId: e.appId,
					timestamp: e.timestamp,
					nonceStr: e.nonceStr,
					signature: e.signature,
					jsApiList: ["onMenuShareTimeline", "onMenuShareAppMessage", "onMenuShareQQ", "onMenuShareWeibo", "onMenuShareQZone"],
					openTagList: ["wx-open-launch-app", "wx-open-launch-weapp"]
				})
			},
			o = function(e) {
				wx.ready(function() {
					wx.onMenuShareTimeline({
						title: e.title,
						link: e.link,
						imgUrl: e.imgUrl,
						success: function() {},
						cancel: function() {}
					}), wx.onMenuShareAppMessage({
						title: e.title,
						desc: e.desc,
						link: e.link,
						imgUrl: e.imgUrl,
						type: "",
						dataUrl: "",
						success: function() {},
						cancel: function() {}
					}), wx.onMenuShareQQ({
						title: e.title,
						desc: e.desc,
						link: e.link,
						imgUrl: e.imgUrl,
						success: function() {},
						cancel: function() {}
					}), wx.onMenuShareWeibo({
						title: e.title,
						desc: e.desc,
						link: e.link,
						imgUrl: e.imgUrl,
						success: function() {},
						cancel: function() {}
					}), wx.onMenuShareQZone({
						title: e.title,
						desc: e.desc,
						link: e.link,
						imgUrl: e.imgUrl,
						success: function() {},
						cancel: function() {}
					})
				})
			};
		cc._RF.pop()
	}, {}]
}, {}, ["main-controller", "over-line", "product", "start-button", "weixin", "use_v2.1-2.2.1_cc.Toggle_event"]);